﻿<UserControl x:Class="VSTalk.Engine.View.RoomChat"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:entitySession="clr-namespace:VSTalk.Engine.Core.EntitySession"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\Images\vstalk.icons.xaml" />
                <ResourceDictionary Source="..\Resources\Icons.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type Paragraph}">
                <Setter Property="Margin"
                        Value="0" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="2*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" Background="{DynamicResource WhiteBrush}">
                <ContentControl Content="{Binding ChatTextBox}" />
            </Border>
            <GridSplitter Grid.Column="1"
                          ResizeBehavior="PreviousAndNext"
                          HorizontalAlignment="Stretch"
                          ResizeDirection="Columns"
                          Width="5" />
            <ListBox Grid.Column="2"
                     ItemsSource="{Binding Context.Members}">
                <ListBox.ItemTemplate>
                    <DataTemplate DataType="entitySession:IRoomMember">
                        <TextBlock Text="{Binding Name}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

        <GridSplitter Grid.Row="1"
                      ResizeBehavior="PreviousAndNext"
                      HorizontalAlignment="Stretch"
                      ResizeDirection="Rows"
                      Height="5" />
        <DockPanel Grid.Row="2">
            <ToolBar Height="27"
                     DockPanel.Dock="Top">
                <ToolBar.Resources>
                    <Style TargetType="{x:Type Rectangle}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}"
                                         Value="False">
                                <Setter Property="Opacity"
                                        Value="0.30" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ToolBar.Resources>
                <Button Command="ApplicationCommands.Cut"
						ToolTip="Cut (CTRL+X)">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource vstalk_scissors}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Button Command="ApplicationCommands.Copy"
                        ToolTip="Copy (CTRL+C)">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource appbar_page_copy}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Button Command="ApplicationCommands.Paste"
                        ToolTip="Paste (CTRL+V)">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource appbar_clipboard_file}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Separator />
                <Button Command="ApplicationCommands.Undo"
                        ToolTip="Undo (CTRL+Z)">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource appbar_undo}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Button Command="ApplicationCommands.Redo"
                        ToolTip="Redo (CTRL+Y)">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource appbar_redo}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Separator />
                <Button Command="{Binding PasteDebugOutput, Mode=OneWay}"
                    ToolTip="Paste Output">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource vstalk_output}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
                <Button Command="{Binding PasteCallStack, Mode=OneWay}"
                    ToolTip="Paste Callstack">
                    <Rectangle Width="14"
                               Height="16">
                        <Rectangle.Fill>
                            <VisualBrush Stretch="Fill"
                                         Visual="{StaticResource vstalk_callstack}" />
                        </Rectangle.Fill>
                    </Rectangle>
                </Button>
            </ToolBar>
            <Border Background="{DynamicResource WhiteBrush}">
                <ContentControl Content="{Binding MessageTextBox}" />
            </Border>
        </DockPanel>
    </Grid>
</UserControl>
